package packagename.data 
{
	
	// HIVE
	import org.hive.data.ContentList;
	import org.hive.data.IContentList;

	public class ProjectNameContentList extends ContentList implements IContentList 
	{
		function ProjectNameContentList(filename:String)
		{
			super(filename);
		}
		
		// METHODS HERE TO PARSE XML AND RETURN YOUR DATA HOWEVER YOU PREFER
		
		
		public function getContentByName (name:String ):String
		{
			return super.data.contentlist.content.(@name == name).@url.toString();
		}
		
		public function getMessage(message:String):String
		{
			return super.data.contentlist.content.(@name == message).toString();
		}
									
		public function getFeedPath():String
		{
			return super.data.contentlist.content.(@name == "rssfeed").@url.toString();
		}
		
		public function getDefaultProjectItemBySection( id:String ):Object
		{
			var projectName:String = super.data.contentlist.section.(@id == id).@itemName.toString();
			
			var projectObj:Object = new Object();
			
			projectObj.swfPath =  super.data.contentlist.item.(@name == itemName).@filename.toString();
			projectObj.title = super.data.contentlist.item.(@name == itemName).@name.toString();
			projectObj.description = super.data.contentlist.item.(@name == itemName).@description.toString();
			
			return projectObj;
		}
					
		public function getPhotos():Array
		{
			var photosObjArray:Array = new Array();
			var photoXMLList:XMLList = super.data.contentlist.photos.content;
			
			for each ( var imageXML:XML in photoXMLList )
			{
				var photoObj:Object = new Object();
				
				photoObj.caption = imageXML.@caption.toString();
				photoObj.path = imageXML.@path.toString();
				
				//trace("ContentList /photoObj.caption: " + photoObj.caption);
				//trace("ContentList /photoObj.path: " + 	photoObj.path);
				
				photosObjArray.push( photoObj )
			}
				
			return photosObjArray;
		}
		
		
	}
	
}